/* eslint-disable camelcase */
import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    token: '' || localStorage.getItem('token')
  },
  mutations: {
    // 修改token，并将token存入localStorage
    handleToken: (state, token) => {
      state.token = token
      localStorage.setItem('token', token)
    }
  },
  getters: {
    getToken: (state) => state.token
  },
  actions: {
  },
  modules: {}
})
